﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebSite.Controls
{
    public partial class AddressArea : System.Web.UI.UserControl
    {
        string _provence = "选择省";

        public string Provence
        {
            get
            {

                return _provence;
            }
            set { _provence = value; }
        }
        string _area = "选择地区";

        public string City
        {
            get { return _area; }
            set { _area = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public string GetProvenceCity()
        {
            return Request.Form[this.ddlProvence.Name] + "," + Request.Form[this.ddlCity.Name] + ",";
        }

        public string GetProvence()
        {
            return Request.Form[this.ddlProvence.Name];
        }

        public string GetCity()
        {
            return Request.Form[this.ddlCity.Name];
        }

        public void SetProvence(string sProvence)
        {
            Provence = sProvence;
            this.ddlProvence.Items.Insert(0, new ListItem(sProvence));
        }
        public void SetCity(string sCity)
        {
            City = sCity;
            this.ddlCity.Items.Insert(0, new ListItem(sCity));
        }
    }
}